package com.ddpyjqtd.proxy.jdkproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class JdkProxy implements InvocationHandler {

	private Object target;

	public JdkProxy(Object target) {
		this.target = target;
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		Object obj = null;
		System.out.println("...这里是jdk的代理，提出你的需求");
		obj = method.invoke(target, args);
		System.out.println(".......已接受委托，请等待，客服会联系您。。。");

		return obj;
	}
}
